package com.yspa.util;

import com.baidu.yun.push.exception.PushClientException;
import com.baidu.yun.push.exception.PushServerException;
import com.baidu.yun.push.model.PushMsgToTagRequest;

public class AndroidPushMsgToTag {
	public static void main(String[] args) 
			throws PushClientException,PushServerException {
	
		// pushTagTpye = 1 for common tag pushing
		PushMsgToTagRequest request = new PushMsgToTagRequest()
				.addTagName("10427")
				.addMsgExpires(new Integer(3600))
				.addMessageType(1)  // 添加透传消息
				// .addSendTime(System.currentTimeMillis() / 1000 + 120) //设置定时任务
				.addMessage("{\"title\":\"TEST\",\"description\":\"Hello Baidu push!\"}")
				.addDeviceType(3);
		
		PushMsg.pushMsgToTag(request);
			
	}	
}
